package javaapplication1.view;

import java.util.Scanner;

import javaapplication1.control.LoginControl;

public class LoginView {

	private static LoginControl loginControl = new LoginControl();

	public static void login() {
		Scanner scanner = new Scanner(System.in);
		System.out.print("请选择登陆方式，输入1为宠物主人登陆，输入2为宠物商店登陆");
		int choose = scanner.nextInt();
		String username = null;
		String password = null;
		if (choose == 1) {
			System.out.print("宠物主人账号：");
			username = scanner.next();
			System.out.print("宠物主人密码：");
			password = scanner.next();
		} else if (choose == 2) {
			System.out.print("宠物商店账号：");
			username = scanner.next();
			System.out.print("宠物商店密码：");
			password = scanner.next();
		} else {
			System.out.println("输入有误，请重新输入！");
			LoginView.login();
		}
		loginControl.loginControl(choose, username, password);
	}

}